package Logik;

import GUI.Startbildschirm;
import Interfaces.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *Startet die GUI des Programms
 *@author Andreas Konsek
 */
public class Projekt {

    public static void main(String[] args) {
        
        Startbildschirm start = new Startbildschirm();
        start.setVisible(true);

        Medienverwaltung mv = new Medienquelle();
        Kundenverwaltung kv = new Kundenquelle();

       mv.DateiErneuern();

        Medium m1 = new Medium(1, "Sieben", "Thriller", 1.20, 0);
        Medium m2 = new Medium(2, "Star Wars IV", "Sci-Fi", 1.00, 0);
        Medium m5 = new Medium(3, "Movie 47", "Komödie", 1.20, 0);
        Medium m6 = new Medium(4, "Hot Fuzz", "Galgenhumor", 0.90, 0);
        XBOX m8 = new XBOX(6, "Halo", "Shooter", 3.2, 0, true, false);
       
        mv.anlegen(m1);
        mv.anlegen(m2);
        mv.anlegen(m5);
        mv.anlegen(m6);
        //mv.anlegen(m8);
       
        try {
            String dk1 = "22.12.1997";
            String dk2 = "14.03.1990";
            String dk3 = "09.05.2004";
            String dk4 = "10.11.1989";
            String dk5 = "21.05.1961";
            SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");

            Kunde k1 = new Kunde(1, "Max Mustermann", sdf.parse(dk1));
            Kunde k2 = new Kunde(2, "Hans Huber", sdf.parse(dk2));
            Kunde k3 = new Kunde(3, "Manuel Maier", sdf.parse(dk3));
            Kunde k4 = new Kunde(4, "Josef Brunner", sdf.parse(dk4));
            Kunde k5 = new Kunde(5, "Manfred Mann", sdf.parse(dk5));

            kv.anzeigen().clear();
            kv.speichern();

            kv.anlegen(k1);
            kv.anlegen(k2);
            kv.anlegen(k3);
            kv.anlegen(k4);
            kv.anlegen(k5);
            kv.speichern();

        } catch (ParseException ex) {
            Logger.getLogger(Projekt.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
